package com.ptszyxx.popose.module.main.popo;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.FragmentPopoBinding;
import com.ptszyxx.popose.module.main.game.GameFragment;
import com.ysg.base.BaseFragment;
import com.ysg.base.BaseViewModel;
import java.util.ArrayList;
import java.util.List;

public class PopoFragment extends BaseFragment<FragmentPopoBinding, BaseViewModel> {
    private String[] mTitles;

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_popo;
    }

    @Override
    public int initVariableId() {
        return 0;
    }

//    @Override
//    public GameVM initViewModel() {
//        AppViewModelFactory factory = AppViewModelFactory.getInstance(getActivity().getApplication());
//        return ViewModelProviders.of(this, factory).get(GameVM.class);
//    }

    @Override
    public void initView() {
        super.initView();
        mTitles = getResources().getStringArray(R.array.popo_tab);
        binding.tabLayout.initGrid(this, binding.viewPager, mTitles, getFragments());
        binding.tabLayout.setCurrentTab(1);
    }

    public List<Fragment> getFragments(){
        List<Fragment> fragments = new ArrayList<>();
//        fragments.add(new TripFragment(false));
        fragments.add(new GameFragment());
//        fragments.add(new FishFragment(false));
//        fragments.add(new MapFragment());
        return fragments;
    }



}
